<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
	<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0"><meta name="renderer" content="webkit">

    <title>首页</title>
    <meta name="keywords" content="H+后台主题,后台bootstrap框架,会员中心主题,后台HTML,响应式后台">
    <meta name="description" content="H+是一个完全响应式，基于Bootstrap3最新版本开发的扁平化主题，她采用了主流的左右两栏式布局，使用了Html5+CSS3等现代技术">

    <link href="houtai/css/bootstrap.min.css?v=3.4.0" rel="stylesheet">
    <link href="houtai/font-awesome/css/font-awesome.css?v=4.3.0" rel="stylesheet">
    <!-- Morris -->
    <link href="houtai/css/plugins/morris/morris-0.4.3.min.css" rel="stylesheet">
    <!-- Gritter -->
    <link href="houtai/js/plugins/gritter/jquery.gritter.css" rel="stylesheet">
    <link href="houtai/css/animate.css" rel="stylesheet">
    <link href="houtai/css/style.css?v=2.2.0" rel="stylesheet">
    <style type="text/css">
        #first{
            border-left: none;
        }
        .hiddenTD{
          display: none;
        }
       .form-group span{
         color: red;
        }
    </style>
    <script>
        <c:if test="${sessionUsername==null}">
        window.location.href = "login.jsp";
        </c:if>
    </script>
</head>
<body>
 
    <div id="wrapper">
        <nav class="navbar-default navbar-static-side" role="navigation">
            <div class="sidebar-collapse">
                <ul class="nav" id="side-menu">
                    <li class="nav-header">
                        <div class="dropdown profile-element"> <span>
                            <img alt="image" class="img-circle" src="houtai/img/profile_small.jpg" />
                             </span>
                            <a data-toggle="dropdown" class="dropdown-toggle" href="index.html#">
                                <span class="clear"> <span class="block m-t-xs"> <strong class="font-bold">${sessionUsername}</strong>
                             </span>  <span class="text-muted text-xs block" >${sessionTitle}<b class="caret"></b></span> </span>
                            </a>
                            <ul class="dropdown-menu animated fadeInRight m-t-xs">
                                <li class="divider"></li>
                                <li><a href="remove">安全退出</a>
                                </li>
                            </ul>
                        </div>
                        <div class="logo-element">
                            ${sessionUsername}
                        </div>

                    </li>
                    <li class="active" id="first">
                        <a href="index.do" style="border-left: 0px"><i class="fa fa-desktop"></i>主页 </a>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa fa-globe"></i> <span class="nav-label">文章管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getArticleList.do">文章列表</a>
                            </li>
                            <li><a href="getClassifyList.do">文章分类列表</a>
                            </li>
                        </ul>
                    </li>

                    <li>
                        <a href="#"><i class="fa fa fa-globe"></i> <span class="nav-label">订单管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getOrders">订单列表</a>
                            </li>
                            <li><a href="getDetails">流水列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa fa-globe"></i> <span class="nav-label">项目管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getProjectList">项目列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa fa-globe"></i> <span class="nav-label">车辆类型管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getTypesList">车辆类型列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-flask"></i> <span class="nav-label">管理员设置</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="getMembersList.do">管理员列表</a>
                            </li>
                        </ul>
                    </li>
                    <li>
                        <a href="#"><i class="fa fa-flask"></i> <span class="nav-label">系统管理</span><span class="fa arrow"></span></a>
                        <ul class="nav nav-second-level">
                            <li><a href="authGroupList.do">角色管理</a>
                            </li>
                            <li><a href="modulesList.do">模块管理</a>
                            </li>
                        </ul>
                    </li>
                </ul>
            </div>
        </nav>

        <div id="page-wrapper" class="gray-bg dashbard-1">
            <div class="row border-bottom">
                <nav class="navbar navbar-static-top"   style="margin-bottom: 0">
                    <div class="navbar-header">
                        <a class="navbar-minimalize minimalize-styl-2 btn btn-primary " href="#"><i class="fa fa-bars"></i> </a>
                        <form   class="navbar-form-custom" method="post" action="search_results.html">
                            <div class="form-group">
                                <input type="text" placeholder="请输入您需要查找的内容 …" class="form-control" name="top-search" id="top-search">
                            </div>
                        </form>
                    </div>
                    <ul class="nav navbar-top-links navbar-right">
                        <li>
                            <span class="m-r-sm text-muted welcome-message"><a href="index.html" title="返回首页"><i class="fa fa-home"></i></a>安全隐患管理系统欢迎您</span>
                        </li>

                        <li>
                            <a href="remove">
                                <i class="fa fa-sign-out"></i> 退出
                            </a>
                        </li>
                    </ul>

                </nav>
            </div> 
    


<!-----------------------------------------------------产品列表------------------------------------------------------------------>
    <div class="right"  id="mainFrame">
		<div class="right_cont">
			<ul class="breadcrumb">
			    <li> 当前位置：</li>
				<li> <a href="index.jsp">首页</a> </li>
				<li><a href="modulesList.do">模块管理列表</a></li>
			</ul>

			<div class="title_right">
					 <span class="pull-right margin-bottom-5"><button type="button" class="btn btn-primary" data-toggle="modal"
								data-target="#insertModal">添加模块</button> </span><strong>模块列表</strong>
					</div>


			<table class="table table-bordered table-striped table-hover">
				<tbody>
				<tr align="center">
					<td><strong>序列号</strong></td>
					<td><strong>系统管理</strong></td>
					<td><strong>状态</strong></td>
					<td><strong>操作</strong></td>
				</tr>
				<c:forEach items="${modules}" var="h" varStatus="v">
					<tr align="center">
							<td>${h.id}</td>
							<td>${h.moduleName}</td>		
							<td> 
							    <c:if test="${h.status==1}">
											<button class="btn btn-info btn-circle juzhong" type="button"><i class="fa fa-check"></i></button>
										</c:if> <c:if test="${h.status==0}">
											<button class="btn btn-warning btn-circle juzhong" type="button"><i class="fa fa-times"></i></button>
										</c:if>
							</td>				 
							<td>
								 <div class="btn-group btn-group-xs">								
                                     <button class="btn btn-info btn-primary" data-toggle="modal" data-target="#Modal" type="button" onclick="update(this)"><i class="fa fa-paste"></i> 编辑</button>
                                     <button class="btn btn-warning" type="button" data-toggle="modal" data-target="#myModal6" onclick="remove(this)"><i class="fa fa-warning"></i><span class="bold">删除</span></button>
                                     <button class="btn btn-success" type="button"  onclick="other(this)"> 规则标识 </button>
                                 </div>
							</td>
						</tr> 			
				 </c:forEach>
				 
                <tr>
					<td colspan='13'>
						<div class="digg">  </div>
					</td>
				</tr>
				</tbody>
			</table>
		</div>
	</div>
</div>
</div>
<!-----------------------------------------------------修改分类模拟窗口------------------------------------------------------------------>
<div class="modal inmodal" id="Modal" tabindex="-1"  style="display: none;">
				<div class="modal-dialog">
					<div class="modal-content animated flipInY">
						<div class="modal-header">
							<button type="button" class="close" data-dismiss="modal">
								<span>×</span><span class="sr-only">Close</span>
							</button>
							<h4 class="modal-title">分类信息</h4>
							<small class="font-bold">修改分类信息 </small>
						</div>
							<div class="modal-body">
								<form name="addForm" action="modifyModule.do" method='post'>
                                         <input type="hidden" name="id" id="rid"/> 
										<div class="row form-body form-horizontal m-t">																	
												<div class="form-group">
													<label class="col-sm-3 control-label">系统管理名称：</label>
													<div class="col-sm-9">
														<input type="text" name="moduleName" id="moduleName" class="form-control"
															placeholder="请输入系统管理title..." required="required">
														<span class="moduleName">${errormessage}</span>
													</div>
												</div> 																																					 												 				 
									 </div>								 									 							
									<div class="modal-footer">
										<button type="submit" class="btn btn-info" style="width:80px">添加</button>
										<button class="btn" data-dismiss="modal"  style="width:80px">取消</button>
									</div>
								</form>
							</div> 
					</div>
				</div>
			</div>
<!-----------------------------------------------------添加分类模拟窗口------------------------------------------------------------------>
<div class="modal inmodal" id="insertModal" tabindex="-1"  style="display: none;">
    <div class="modal-dialog">
        <div class="modal-content animated flipInY">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal">
                    <span>×</span><span class="sr-only">Close</span>
                </button>
                <h4 class="modal-title">分类信息</h4>
                <small class="font-bold">修改分类信息 </small>
            </div>

            <div class="modal-body">
                <form name="addForm" action="insertModule.do" method='post'>
                    <div class="row form-body form-horizontal m-t">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">系统管理名称：</label>
                            <div class="col-sm-9">
                                <input type="text" name="moduleName" id="moduleName_in" class="form-control"
                                    placeholder="请输入系统管理title..." required="required">
                                <span class="moduleName_in">${errormessage}</span>
                            </div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="submit" class="btn btn-info" style="width:80px">添加</button>
                        <button class="btn" data-dismiss="modal"  style="width:80px">取消</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>
<!-----------------------------------------------------删除分类模拟窗口------------------------------------------------------------------>
<div class="modal inmodal fade" id="myModal6" tabindex="-1"style="display: none;">
    <div class="modal-dialog modal-sm">
        <div class="modal-content">
            <div class="modal-header">
                <button type="button" class="close" data-dismiss="modal"><span>×</span><span class="sr-only">Close</span></button>
                <h4 class="modal-title">删除窗口</h4>
            </div>
           <form  action="deleteModule.do" method='get'>
            <div class="modal-body">
                您确定要删除吗?
                <input type="hidden" name="id" id="deleteId">
            </div>
             <div class="modal-footer">
                <button type="submit" class="btn btn-primary">删除</button>
                <button type="button" class="btn btn-white" data-dismiss="modal">取消</button >
            </div>
        </form>
        </div>
    </div>
</div>

	 
    <!--修改的模态框的取值赋值-->   
   <script type="text/javascript">
   
      function other(obj){
           var tds = $(obj).parent().parent().parent().find('td'); 
           var mid =tds[0].innerHTML;  
           window.location.href="authRuleList.do?mid="+mid;
      }
      
      
   
     function update(obj){
        var tds = $(obj).parent().parent().parent().find('td'); 
        //获取列表中的值
        var uid =tds[0].innerHTML;  
        var moduleName =tds[1].innerHTML;  
        //向模态框传值        
        $('#rid').val(uid);
        $('#moduleName').val(moduleName); 
     }
     
  //删除模态框
    function remove(obj){
    var tds = $(obj).parent().parent().parent().find('td'); 
    //获取表格中的一行数据
     var deleteId =tds[0].innerHTML; 
     $('#deleteId').val(deleteId);
     }
   </script>
 
    <!-- Mainly scripts -->
    <script src="houtai/js/jquery-2.1.1.min.js"></script>
    <script src="houtai/js/bootstrap.min.js?v=3.4.0"></script>
    <script src="houtai/js/plugins/metisMenu/jquery.metisMenu.js"></script>
    <script src="houtai/js/plugins/slimscroll/jquery.slimscroll.min.js"></script>
 
    <!-- Custom and plugin javascript -->
    <script src="houtai/js/hplus.js?v=2.2.0"></script>
    <script src="houtai/js/plugins/pace/pace.min.js"></script>

 
</body>

</html>